package me.sunpeng.principle;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author sp
 */
public class Test {
    public static void main(String[] args) {

        List<Integer> integers = List.of(1, 2, 3, 4);
            integers.stream().parallel().forEach((Test::extracted));



    }

    private static void extracted(Integer v) {
        System.out.println(v.intValue());
        System.out.println(Thread.currentThread().getName());
        try {
            TimeUnit.SECONDS.sleep(2);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

